<?php if(isset($notification)):?>
<b><?=$notification?></b>
<?php else:?>

<script type="text/javascript">

    window.addEvent('domready', function() {
        
        $('group_add').addEvent('submit', function(e) {
            
            e.stop();
            $('ajax-loader').removeClass('hide');
            
            this.set('send', {
                url : '<?=current_url()?>',
                onComplete: function(response) {

                    if (response.test('<b><?=lang('group_success_add')?></b>')) {

                        ModalBoxClose();
                    }
                    else {

                        $('form_error').set('html', response);
                    }
                    
                    ajax_url('<?=modul_url('modul/user/groups', true)?>', 'main_content');
                }
            });
            
            this.send();
        });
    });
</script>

<?=form_open(current_url(), array('class' => 'hform', 'id' => 'group_add'), array('add' => true));?>

<span id="form_error"></span>

<p>
    <label><?=lang('group_title')?></label>
    <?=form_input('title', set_value('title'))?>
</p>
<p>
    <label><?=lang('group_copy')?></label>
    <?=form_dropdown('group_copy', $groups, set_value('group_copy'))?>
</p>

<?=form_submit('add', lang('create'));?> <?=form_reset('reset', lang('reset'));?>

</form>
<?php endif;?>